 function Qiniu(fileData) {
   let qiniu = require('qiniu'),
     formidable = require('formidable'),
     express = require('express'),
     router = express.Router();
   router.post('/qiniu', function (req, res, next) {

     let bucket = 'mock',
       key = '',
       form = formidable.IncomingForm(),
       token, putPolicy;
     form.uploadDir = path.join(__dirname, '', 'public/img/upload');
     form.keepExtensions = true
     form.parse(req, function (err, fields, files) {
       if (err) {
         console.log(err);
       }
       key = files.mypic.path.split(path.sep).pop();
       putPolicy = new qiniu.rs.PutPolicy(bucket + ':' + key)
       //设置回调
       // putPolicy.callbackUrl = 'http://localhost:81/test/callback'
       // putPolicy.callbackBody = 'filename=$(fname)&filesize=$(fsize)'

       token = putPolicy.token()

       console.log('token', token)
       let extra = new qiniu.io.PutExtra()
       qiniu.io.putFile(token, key, files.mypic.path, extra, function (err, ret) {
         if (err) {
           console.log(err)
         }
         console.log('ret', ret);
         res.json({
           token: token,
           ret: ret,
           files: files,
           fields: fields
         })
       })
     })

   })
 }
 //  module.exports = Qiniu;
 //  let Qn = require('./qiniu')
 Qiniu();